﻿using System;
using JetBrains.Annotations;

namespace MugenMvvmToolkit.Attributes
{
    /// <summary>
    ///     Specifies the metadata class to associate with a data model class.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public sealed class MetadataTypeAttribute : Attribute
    {
        #region Constructors

        /// <summary>
        ///     Initializes a new instance of the <see cref="T:MugenMvvmToolkit.Attributes.MetadataTypeAttribute" /> class.
        /// </summary>
        /// <param name="metadataClassType">The metadata class to reference.</param>
        /// <exception cref="T:System.ArgumentNullException">
        ///     <paramref name="metadataClassType" /> is null.
        /// </exception>
        public MetadataTypeAttribute([NotNull]Type metadataClassType)
        {
            Should.NotBeNull(metadataClassType, "metadataClassType");
            MetadataClassType = metadataClassType;
        }

        #endregion

        #region Properties

        /// <summary>
        ///     Gets the metadata class that is associated with a data-model partial class.
        /// </summary>
        public Type MetadataClassType { get; private set; }

        #endregion
    }
}